﻿using System.Collections.Generic;
using XmlStudio.Controllers.Interfaces;
using XmlStudio.DataLayer;
using XmlStudio.Enums;
using XmlStudio.Interfaces;

namespace XmlStudio.Controllers {
    /// <summary>
    /// Controller. Calls xmlModel's methods. MVC pattern implementation.
    /// </summary>
    internal class Controller : IController {
        #region Fields
        #region Public
        #endregion

        #region Private
        IXmlModel xmlModel;
        IXsdModel xsdModel;
        IXmlView view;
        #endregion
        #endregion

        #region Constructors
        #region Public
        /// <summary>
        /// Initializes a new instance of the <see cref="Controller"/> class.
        /// </summary>
        /// <param name="model">Appropriate xml model.</param>
        /// <param name="view">Appropriate view.</param>
        public Controller(IXmlModel model, IXmlView view) {
            this.xmlModel = model;
            this.view = view;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Controller"/> class.
        /// </summary>
        /// <param name="model">Appropriate xsd model.</param>
        /// <param name="view">Appropriate view.</param>
        public Controller(IXsdModel model, IXmlView view) {
            this.xsdModel = model;
            this.xmlModel = model; // so that xmlModel can be used for xml parts even when working with xsd
            this.view = view;
        }
        #endregion
        #endregion

        #region Methods
        #region Public
        /// <summary>
        /// Calls xmlModel to validate document against DTD.
        /// </summary>
        public void ValidateDtd() {
            this.xmlModel.ValidateDtd();
        }

        /// <summary>
        /// Calls xmlModel to validate document against xsd.
        /// </summary>
        public void ValidateXsdAsync() {
            this.xmlModel.ValidateXsdAsync();
        }

        /// <summary>
        /// Calls xmlModel to cancel the xsd validation.
        /// </summary>
        public void CancelValidateXsd() {
            this.xmlModel.CancelValidateXsd();
        }

        /// <summary>
        /// Calls xmlModel to validate document against DTD.
        /// </summary>
        public void ValidateDtdAsync() {
            this.xmlModel.ValidateDtdAsync();
        }

        /// <summary>
        /// Calls xmlModel to cancel the DTD validation.
        /// </summary>
        public void CancelValidateDtd() {
            this.xmlModel.CancelValidateDtd();
        }

        /// <summary>
        /// Sets document type.
        /// </summary>
        /// <param name="rootElementName">Name of the root element.</param>
        /// <param name="publicId">Value for PUBLIC attribute (optional).</param>
        /// <param name="systemId">Path to dtd.</param>
        /// <param name="internalSubset">Internal subset (dtd) (optional).</param>
        public void SetDocumentType(string rootElementName, string publicId, string systemId, string internalSubset) {
            this.xmlModel.SetDocumentType(rootElementName, publicId, systemId, internalSubset);
        }

        /// <summary>
        /// Removes DOCTYPE.
        /// </summary>
        public void RemoveDocumentType() {
            this.xmlModel.RemoveDocumentType();
        }

        /// <summary>
        /// Sets the xml model.
        /// </summary>
        /// <param name="model"><see cref="IXmlModel"/> to set.</param>
        public void SetModel(IXmlModel model) {
            this.xmlModel = model;
        }

        /// <summary>
        /// Sets the xsd model.
        /// </summary>
        /// <param name="model"><see cref="IXsdModel"/> to set.</param>
        public void SetModel(IXsdModel model) {
            this.xsdModel = model;
            this.xmlModel = model;
        }

        /// <summary>
        /// Sets the view.
        /// </summary>
        /// <param name="view"><see cref="IXmlView"/> to set.</param>
        public void SetView(IXmlView view) {
            this.view = view;
        }

        /// <summary>
        /// Opens the specified file.
        /// </summary>
        /// <param name="path">Path to open.</param>
        /// <returns>True if file the current application mode was changed, false otherwise.</returns>
        public bool OpenXmlFile(string path) {
            if(this.xmlModel is IXsdModel) {
                this.view.InitXmlMode(path);
                return true;
            } else {
                this.xmlModel.Open(path);
                this.GetRootElement();
                return false;
            }
        }

        /// <summary>
        /// Opens the specified file.
        /// </summary>
        /// <param name="path">Path to open.</param>
        /// <returns>True if file the current application mode was changed, false otherwise.</returns>
        public bool OpenXsdFile(string path) {
            if(this.xsdModel == null) {
                // init xsd model
                this.view.InitXsdMode(path);
                return true;
            } else {
                this.xsdModel.Open(path);
                this.GetRootElement();
                return false;
            }
        }

        /// <summary>
        /// Gets the root element of the document.
        /// </summary>
        /// <returns>BigXmlNode representing the root element.</returns>
        public BigXmlNode GetRootElement() {
            var node = this.xmlModel.GetRootElement();

            return node;
        }

        /// <summary>
        /// Expands the specified node.
        /// </summary>
        /// <param name="node"><see cref="BigXmlNode"/> to expand.</param>
        /// <param name="range">Range to expand.</param>
        /// <param name="withSubtree">Indicates whether to expand node with the whole subtree.</param>
        public void ExpandNode(BigXmlNode node, string range = "", bool withSubtree = false) {
            this.xmlModel.ExpandNode(node, range, withSubtree);
        }

        /// <summary>
        /// Expands the whole document.
        /// </summary>
        public void ExpandAll() {
            this.xmlModel.ExpandAll();
        }

        /// <summary>
        /// Collapses the specified node.
        /// </summary>
        /// <param name="node">Node to collapse.</param>
        public void CollapseNode(BigXmlNode node) {
            this.xmlModel.CollapseNode(node);
        }

        /// <summary>
        /// Calls xmlModel to select nodes according to the XPath query.
        /// </summary>
        /// <param name="xpath">XPath query.</param>
        public IEnumerable<BigXmlNode> SelectNodes(string xpath) {
            return this.xmlModel.SelectNodes(xpath);
        }

        /// <summary>
        /// Renames the specified node.
        /// </summary>
        /// <param name="node"><see cref="BigXmlNode"/> to rename.</param>
        /// <param name="name">Element's new name.</param>
        public void RenameElement(BigXmlNode node, string name) {
            this.xmlModel.RenameElement(node, name);
        }

        /// <summary>
        /// Renames the specified node.
        /// </summary>
        /// <param name="node">Node to rename.</param>
        /// <param name="localName">Element's new local name.</param>
        /// <param name="namespaceUri">Element's new namespace uri.</param>
        /// <param name="prefix">Element's new prefix.</param>
        public void RenameElement(BigXmlNode node, string localName, string namespaceUri, string prefix) {
            this.xmlModel.RenameElement(node, localName, namespaceUri, prefix);
        }

        /// <summary>
        /// Removes the specified node.
        /// </summary>
        /// <param name="nodeToRemove">Node to remove.</param>
        /// <param name="removeSubtree">Indicates whether to remove the whole subtree with the node or not.</param>
        public void RemoveNode(BigXmlNode nodeToRemove, bool removeSubtree) {
            this.xmlModel.RemoveNode(nodeToRemove, removeSubtree);
        }

        /// <summary>
        /// Moves the specified node in the collection of child nodes.
        /// </summary>
        /// <param name="nodeToMove"><see cref="BigXmlNode"/> to move.</param>
        /// <param name="previousSibling"><see cref="BigXmlNode"/> which should be moved node's new previous sibling.</param>
        public void ChangeNodeOrder(BigXmlNode nodeToMove, BigXmlNode previousSibling) {
            this.xmlModel.ChangeNodeOrder(nodeToMove, previousSibling);
        }

        /// <summary>
        /// Modifies the value of the specified text node which is wrapped in <see cref="BigXmlNode"/>.
        /// </summary>
        /// <param name="node"><see cref="BigXmlNode"/> with the text node to modify.</param>
        /// <param name="text">New value to set.</param>
        public void ModifyTextNode(BigXmlNode node, string text) {
            this.xmlModel.ModifyTextNode(node, text);
        }

        /// <summary>
        /// Undoes the last action.
        /// </summary>
        public void Undo() {
            this.xmlModel.Undo();
        }

        /// <summary>
        /// Redoes the last undone action.
        /// </summary>
        public void Redo() {
            this.xmlModel.Redo();
        }

        /// <summary>
        /// Saves the document.
        /// </summary>
        public void Save() {
            if(this.view != null) {
                this.view.SetProgressBarVisibility(true);
            }

            this.xmlModel.Save(true);
        }

        /// <summary>
        /// Saves the document to the specified path.
        /// </summary>
        /// <param name="path">Path where to save the document.</param>
        public void Save(string path) {
            if(this.view != null) {
                this.view.SetProgressBarVisibility(true);
            }

            this.xmlModel.Save(path, true);
        }

        /// <summary>
        /// Adds a new attribute to the node.
        /// </summary>
        /// <param name="node">Node where to add new attribute.</param>
        /// <param name="name">Name of the attribute to add.</param>
        /// <param name="value">Value of the attribute to add.</param>
        public void AddAttribute(BigXmlNode node, string name, string value) {
            this.xmlModel.AddAttribute(node, name, value);
        }

        /// <summary>
        /// Adds a new attribute to the node.
        /// </summary>
        /// <param name="node">Node where to add new attribute.</param>
        /// <param name="prefix">Prefix of the attribute to add.</param>
        /// <param name="localName">Local name of the attribute to add.</param>
        /// <param name="namespaceUri">Namespace uri of the attribute to add.</param>
        /// <param name="value">Value of the attribute to add.</param>
        public void AddAttribute(BigXmlNode node, string prefix, string localName, string namespaceUri, string value) {
            this.xmlModel.AddAttribute(node, prefix, localName, namespaceUri, value);
        }

        /// <summary>
        /// Removes the specified attribute from the specified node.
        /// </summary>
        /// <param name="node">Node where to remove attribute.</param>
        /// <param name="name">Name of the attribute to remove.</param>
        public void RemoveAttribute(BigXmlNode node, string name) {
            this.xmlModel.RemoveAttribute(node, name);
        }

        /// <summary>
        /// Removes the specified attribute from the specified node.
        /// </summary>
        /// <param name="node">Node where to remove attribute.</param>
        /// <param name="prefix">Prefix of the attribute to remove.</param>
        /// <param name="localName">Local name of the attribute to remove.</param>
        /// <param name="namespaceUri">Namespace uri of the attribute to remove.</param>
        public void RemoveAttribute(BigXmlNode node, string prefix, string localName, string namespaceUri) {
            this.xmlModel.RemoveAttribute(node, prefix, localName, namespaceUri);
        }

        /// <summary>
        /// Updates element's simpleTypes to element has only simpleTypes contained in simpleTypes collection.
        /// </summary>
        /// <param name="node">Node which simpleTypes to update.</param>
        /// <param name="attributes">Collection of <see cref="IBigXmlAttribute"/> instances.</param>
        public void UpdateAttributes(BigXmlNode node, IDictionary<string, IBigXmlAttribute> attributes) {
            this.xmlModel.UpdateAttributes(node, attributes);
        }

        /// <summary>
        /// Gets the raw xml of the currently loaded document.
        /// </summary>
        /// <returns></returns>
        public string GetRawXml() {
            return this.xmlModel.GetRawXml();
        }

        /// <summary>
        /// Adds child element.
        /// </summary>
        /// <param name="parentNode">Parent node where to add this element.</param>
        /// <param name="prefix">Prefix of the element.</param>
        /// <param name="namespaceURI">Namespace uri of the element.</param>
        /// <param name="localName">Local name of the element.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="mode">Insert mode.</param>
        /// <param name="refChild">Reference node.</param>
        public void AddChildElement(BigXmlNode parentNode, string prefix, string namespaceURI, string localName, IDictionary<string, IBigXmlAttribute> attributes, InsertMode mode, BigXmlNode refChild) {
            using(var t = this.xmlModel.BeginTransaction()) {
                t.IsDelayed = false;
                var node = this.xmlModel.CreateElement(prefix, localName, namespaceURI);
                this.xmlModel.AddChildNode(parentNode, node, mode, refChild);
                this.xmlModel.UpdateAttributes(node, attributes);
            }
        }

        /// <summary>
        /// Adds child text node.
        /// </summary>
        /// <param name="parentNode">Parent element.</param>
        /// <param name="text">Text node's value.</param>
        /// <param name="mode">Insert mode.</param>
        /// <param name="refChild">Reference node.</param>
        public void AddChildTextNode(BigXmlNode parentNode, string text, InsertMode mode, BigXmlNode refChild) {
            using(var t = this.xmlModel.BeginTransaction()) {
                t.IsDelayed = false;
                var node = this.xmlModel.CreateTextNode(text);
                this.xmlModel.AddChildNode(parentNode, node, mode, refChild);
            }
        }

        /// <summary>
        /// Creates new root element.
        /// </summary>
        /// <param name="name">Name of the new root element.</param>
        public void CreateRootElement(string name) {
            this.xmlModel.CreateRootElement(name);
        }

        /// <summary>
        /// Creates new root element.
        /// </summary>
        /// <param name="prefix">Prefix of the new element.</param>
        /// <param name="localName">Local name of the new element.</param>
        /// <param name="namespaceUri">Namespace uri of the new element.</param>
        public void CreateRootElement(string prefix, string localName, string namespaceUri) {
            this.xmlModel.CreateRootElement(prefix, localName, namespaceUri);
        }

        public void CreateRootElement(string prefix, string localName, string namespaceURI, IEnumerable<IBigXmlAttribute> attributes) {
            using(var t = this.xmlModel.BeginTransaction()) {
                t.IsDelayed = false;
                var element = this.xmlModel.CreateRootElement(prefix, localName, namespaceURI);
                foreach(var att in attributes) {
                    this.xmlModel.AddAttribute(element, att.Prefix, att.LocalName, att.NamespaceURI, att.Value);
                }
            }
        }

        /// <summary>
        /// Creates new element.
        /// </summary>
        /// <param name="prefix">Prefix of the element to create.</param>
        /// <param name="localName">Local name of the element to create.</param>
        /// <param name="namespaceURI">Namespace uri of the element to create.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElement(string prefix, string localName, string namespaceURI) {
            return this.xmlModel.CreateElement(prefix, localName, namespaceURI);
        }

        /// <summary>
        /// Creates new element.
        /// </summary>
        /// <param name="name">Name of the element to create.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElement(string name) {
            return this.xmlModel.CreateElement(name);
        }

        /// <summary>
        /// Creates new text node.
        /// </summary>
        /// <param name="text">Value of the text node to create.</param>
        /// <returns>Created text node.</returns>
        public BigXmlNode CreateTextNode(string text) {
            return this.xmlModel.CreateTextNode(text);
        }

        /// <summary>
        /// Moves existing subtree to the different position in the xml tree.
        /// </summary>
        /// <param name="subtreeToMove">Root node of the subtree to move.</param>
        /// <param name="newParent">New parent node of the moving subtree.</param>
        /// <param name="insertMode">Insert mode.</param>
        /// <param name="referenceNode">Reference node.</param>
        public void MoveSubtree(BigXmlNode subtreeToMove, BigXmlNode newParent, InsertMode insertMode, BigXmlNode referenceNode) {
            this.xmlModel.MoveSubtree(subtreeToMove, newParent, insertMode, referenceNode);
        }

        /// <summary>
        /// Copies existing subtree to the specified destination in the xml tree.
        /// </summary>
        /// <param name="subtreeToCopy">Root of the subtree to copy.</param>
        /// <param name="destination">Parent node where to copy the subtree.</param>
        /// <param name="insertMode">Insert mode.</param>
        /// <param name="referenceNode">Reference node.</param>
        public void CopySubtree(BigXmlNode subtreeToCopy, BigXmlNode destination, InsertMode insertMode, BigXmlNode referenceNode) {
            this.xmlModel.CopySubtree(subtreeToCopy, destination, insertMode, referenceNode);
        }

        #region Xsd
        public void CheckXsd() {
            this.xsdModel.CheckXsd();
        }

        /// <summary>
        /// Creates element from XMLSchema namespace with xs prefix without any simpleTypes.
        /// </summary>
        /// <param name="name">Local name of the element to create.</param>
        /// <returns>Reference to newly created element.</returns>
        public BigXmlNode CreateXsdElement(string name) {
            return this.xsdModel.CreateXsdElement(name);
        }

        /// <summary>
        /// Creates element all. The all element specifies that the child elements can appear in any order and that each child element can occur zero or one time.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times the element can occur. The value must be 1.</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times the element can occur. The value can be 0 or 1. Default value is 1.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAll(string id, int? maxOccurs, int? minOccurs, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAll(id, maxOccurs, minOccurs, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element annotation. The annotation element is a top level element that specifies
        /// schema comments. The comments serve as inline documentation.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAnnotation(string id, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAnnotation(id, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element any. The any element enables the author to extend the XML document with elements not specified by the schema.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times the any element can occur in the parent element.
        /// The value can be any number &gt;= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1.</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times the any element can occur in the parent element. The value can be any number &gt;= 0. Default value is 1.</param>
        /// <param name="namespace">Optional. Specifies the namespaces containing the elements that can be used. Can be set to one of the following:
        /// * ##any - elements from any namespace is allowed (this is default)
        /// * ##other - elements from any namespace that is not the namespace of the parent element can be present
        /// * ##local - elements must come from no namespace
        /// * ##targetNamespace - elements from the namespace of the parent element can be present
        /// * List of {URI references of namespaces, ##targetNamespace, ##local} - elements from a space-delimited list of the namespaces can be present</param>
        /// <param name="processContents">Optional. Specifies how the XML processor should handle validation against the elements specified by this any element. Can be set to one of the following:
        /// * strict - the XML processor must obtain the schema for the required namespaces and validate the elements (this is default)
        /// * lax - same as strict but; if the schema cannot be obtained, no errors will occur
        /// * skip - The XML processor does not attempt to validate any elements from the specified namespaces</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAny(string id, string maxOccurs, string minOccurs, string @namespace, ProcessContents? processContents,
            IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAny(id, maxOccurs, minOccurs, @namespace, processContents, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element anyAttribute. The anyAttribute element enables the author to extend the XML document with simpleTypes not specified by the schema.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="namespace">Optional. Specifies the namespaces containing the simpleTypes that can be used. Can be set to one of the following:
        /// * ##any - simpleTypes from any namespace is allowed (this is default)
        /// * ##other - simpleTypes from any namespace that is not the namespace of the parent element can be present
        /// * ##local - simpleTypes must come from no namespace
        /// * ##targetNamespace - simpleTypes from the namespace of the parent element can be present
        /// * List of {URI references of namespaces, ##targetNamespace, ##local} - simpleTypes from a space-delimited list of the namespaces can be present.
        /// </param>
        /// <param name="processContents">Optional. Specifies how the XML processor should handle validation against the elements specified by this any element. Can be set to one of the following:
        /// * strict - the XML processor must obtain the schema for the required namespaces and validate the elements (this is default)
        /// * lax - same as strict but; if the schema cannot be obtained, no errors will occur
        /// * skip - The XML processor does not attempt to validate any elements from the specified namespaces.
        /// </param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAnyAttribute(string id, string @namespace, ProcessContents? processContents,
            IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAnyAttribute(id, @namespace, processContents, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element appInfo. The appInfo element specifies information to be used by the application.
        /// This element must go within an annotation element.
        /// </summary>
        /// <param name="source">Optional. A URI reference that specifies the source of the application information.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAppInfo(string source, XsdElement? parent) {
            return this.xsdModel.CreateElementAppInfo(source, parent);
        }

        /// <summary>
        /// Creates element attribute. The attribute element defines an attribute.
        /// </summary>
        /// <param name="default">Optional. Specifies a default value for the attribute. Default and fixed simpleTypes cannot both be present.</param>
        /// <param name="fixed">Optional. Specifies a fixed value for the attribute. Default and fixed simpleTypes cannot both be present.</param>
        /// <param name="form">Optional. Specifies the form for the attribute. The default value is the value of the attributeFormDefault
        /// attribute of the element containing the attribute. Can be set to one of the following:
        /// * "qualified" - indicates that this attribute must be qualified with the namespace prefix and the no-colon-name (NCName) of the attribute
        /// * unqualified - indicates that this attribute is not required to be qualified with the namespace prefix and is matched against the (NCName) of the attribute
        /// </param>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Optional. Specifies the name of the attribute. Name and ref simpleTypes cannot both be present.</param>
        /// <param name="ref">Optional. Specifies a reference to a named attribute. Name and ref simpleTypes cannot both be present.
        /// If ref is present, simpleType element, form, and type cannot be present.</param>
        /// <param name="type">Optional. Specifies a built-in data type or a simple type. The type attribute can only be present when
        /// the content does not contain a simpleType element.</param>
        /// <param name="use">Optional. Specifies how the attribute is used. Can be one of the following values:
        /// * optional - the attribute is optional (this is default)
        /// * prohibited - the attribute cannot be used
        /// * required - the attribute is required
        /// </param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAttribute(string @default, string @fixed, Form? form, string id, string name,
            string @ref, string type, Use? use, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAttribute(@default, @fixed, form, id, name, @ref, type, use, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element attributeGroup. The attributeGroup element is used to group a set of attribute declarations
        /// so that they can be incorporated as a group into complex type definitions.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Optional. Specifies the name of the attribute group. Name and ref simpleTypes cannot both be present.</param>
        /// <param name="ref">Optional. Specifies a reference to a named attribute group. Name and ref simpleTypes cannot both be present.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementAttributeGroup(string id, string name, string @ref, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementAttributeGroup(id, name, @ref, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element choice. XML Schema choice element allows only one of the elements contained
        /// in the choice declaration to be present within the containing element.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times the choice element can occur in the parent element.
        /// The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times the choice element can occur in the parent the element.
        /// The value can be any number >= 0. Default value is 1</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementChoice(string id, string maxOccurs, string minOccurs, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementChoice(id, maxOccurs, minOccurs, additionalAttributes, parent);
        }
        /// <summary>
        /// Creates element complexContent. The complexContent element defines extensions or restrictions on a complex type that contains mixed content or elements only.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="mixed">Optional. Specifies whether character data is allowed to appear between the child elements of this complexType element. Default is false.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementComplexContent(string id, bool? mixed, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementComplexContent(id, mixed, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element complexType. The complexType element defines a complex type.
        /// A complex type element is an XML element that contains other elements and/or simpleTypes.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Optional. Specifies a name for the element.</param>
        /// <param name="abstract">Optional. Specifies whether the complex type can be used in an instance document. True indicates that an element cannot use this complex type directly but must use a complex type derived from this complex type. Default is false</param>
        /// <param name="mixed">Optional. Specifies whether character data is allowed to appear between the child elements of this complexType element. Default is false. If a simpleContent element is a child element, the mixed attribute is not allowed!</param>
        /// <param name="block">Optional. Prevents a complex type that has a specified type of derivation from being used in place of this complex type. This value can contain #all or a list that is a subset of extension or restriction:
        /// * extension - prevents complex types derived by extension
        /// * restriction - prevents complex types derived by restriction
        /// * #all - prevents all derived complex types
        /// </param>
        /// <param name="final">Optional. Prevents a specified type of derivation of this complex type element. Can contain #all or a list that is a subset of extension or restriction.
        /// * extension - prevents derivation by extension
        /// * restriction - prevents derivation by restriction
        /// * #all - prevents all derivation
        /// </param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementComplexType(string id, string name, bool? @abstract, bool? mixed, string block, string final, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementComplexType(id, name, @abstract, mixed, block, final, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element documentation. The documentation element is used to enter text comments in a schema.
        /// This element must go inside an annotation element.
        /// </summary>
        /// <param name="source">Optional. Specifies the source of the application information.</param>
        /// <param name="lang">Optional. Specifies the language used in the contents.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementDocumentation(string source, string lang, XsdElement? parent) {
            return this.xsdModel.CreateElementDocumentation(source, lang, parent);
        }

        /// <summary>
        /// Creates element element. The element element defines an element.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Optional. Specifies a name for the element. This attribute is required if the parent element is the schema element.</param>
        /// <param name="ref">Optional. Refers to the name of another element. The ref attribute can include a namespace prefix. 
        /// This attribute cannot be used if the parent element is the schema element</param>
        /// <param name="type">Optional. Specifies either the name of a built-in data type, or the name of a simpleType or complexType element.</param>
        /// <param name="substitutionGroup">Optional. Specifies the name of an element that can be substituted with this element. This attribute cannot be used if the parent element is not the schema element</param>
        /// <param name="default">Optional. Specifies a default value for the element (can only be used if the element's content is a simple type or text only).</param>
        /// <param name="fixed">Optional. Specifies a fixed value for the element (can only be used if the element's content is a simple type or text only).</param>
        /// <param name="form">Optional. Specifies the form for the element. "unqualified" indicates that this attribute is not required to be qualified
        /// with the namespace prefix. "qualified" indicates that this attribute must be qualified with the namespace prefix. The default value is the value
        /// of the elementFormDefault attribute of the schema element. This attribute cannot be used if the parent element is the schema element.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times this element can occur in the parent element. The value can be
        /// any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. This attribute
        /// cannot be used if the parent element is the schema element.</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times this element can occur in the parent element.
        /// The value can be any number >= 0. Default value is 1. This attribute cannot be used if the parent element is the schema element.</param>
        /// <param name="nillable">Optional. Specifies whether an explicit null value can be assigned to the element. True enables an instance of the element
        /// to have the null attribute set to true. The null attribute is defined as part of the XML Schema namespace for instances. Default is false.</param>
        /// <param name="abstract">Optional. Specifies whether the element can be used in an instance document. True indicates that the element cannot appear
        /// in the instance document. Instead, another element whose substitutionGroup attribute contains the qualified name (QName) of this element must
        /// appear in this element's place. Default is false.</param>
        /// <param name="block">Optional. Prevents an element with a specified type of derivation from being used in place of this element. This value can contain #all or a list that is a subset of extension, restriction, or equivClass:
        /// * extension - prevents elements derived by extension
        /// * restriction - prevents elements derived by restriction
        /// * substitution - prevents elements derived by substitution
        /// * #all - prevents all derived elements
        /// </param>
        /// <param name="final">Optional. Sets the default value of the final attribute on the element element.  This attribute cannot be used if the parent element is not the schema element. This value can contain #all or a list that is a subset of extension or restriction:
        /// * extension - prevents elements derived by extension
        /// * restriction - prevents elements derived by restriction
        /// * #all - prevents all derived elements
        /// </param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementElement(string id, string name, string @ref, string type, string substitutionGroup, string @default,
            string @fixed, Form? form, string maxOccurs, string minOccurs, bool? nillable, bool? @abstract, string block, string final,
            IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementElement(id, name, @ref, type, substitutionGroup, @default, @fixed, form, maxOccurs, minOccurs,
                nillable, @abstract, block, final, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element extension. The extension element extends an existing simpleType or complexType element.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="base">Required. Specifies the name of a built-in data type, a simpleType element, or a complexType element.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementExtension(string id, string @base, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementExtension(id, @base, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element field. The field element specifies an XPath expression that specifies the value used to define an identity constraint.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="xpath">Required. Identifies a single element or attribute whose content or value is used for the constraint.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementField(string id, string xpath, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementField(id, xpath, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element group. The group element is used to define a group of elements to be used in complex type definitions.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Optional. Specifies a name for the group. This attribute is used only when the schema
        /// element is the parent of this group element. Name and ref simpleTypes cannot both be present.</param>
        /// <param name="ref">Optional. Refers to the name of another group. Name and ref simpleTypes cannot both be present.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times the group element can occur in the parent element.
        /// The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times the group element can occur in the parent element.
        /// The value can be any number >= 0. Default value is 1.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementGroup(string id, string name, string @ref, string maxOccurs, string minOccurs, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementGroup(id, name, @ref, maxOccurs, minOccurs, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element import. The import element is used to add multiple schemas with different target namespace to a document.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="namespace">Optional. Specifies the URI of the namespace to import.</param>
        /// <param name="schemaLocation">Optional. Specifies the URI to the schema for the imported namespace.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementImport(string id, string @namespace, string schemaLocation, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementImport(id, @namespace, schemaLocation, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element include. The include element is used to add multiple schemas with the same target namespace to a document.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="schemaLocation">Required. Specifies the URI to the schema to include in the target namespace of the containing schema.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementInclude(string id, string schemaLocation, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementInclude(id, schemaLocation, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element key. The key element specifies an attribute or element value as a key
        /// (unique, non-nullable, and always present) within the containing element in an instance document.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Required. Specifies the name of the key element.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementKey(string id, string name, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementKey(id, name, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element keyRef. The keyref element specifies that an attribute or element value correspond to those of the specified key or unique element.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Required. Specifies the name of the keyref element.</param>
        /// <param name="refer">Required. Specifies the name of a key or unique element defined in this or another schema.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementKeyRef(string id, string name, string refer, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementKeyRef(id, name, refer, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element list. The list element defines a simple type element as a list of values of a specified data type.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="itemType">Specifies the name of a built-in data type or simpleType
        /// element defined in this or another schema. This attribute is not allowed if the content contains a simpleType element, otherwise it is required.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementList(string id, string itemType, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementList(id, itemType, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element notation. The notation element describes the format of non-XML data within an XML document.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Required. Specifies a name for the element.</param>
        /// <param name="public">Required. Specifies a URI corresponding to the public identifier.</param>
        /// <param name="system">Optional. Specifies a URI corresponding to the system identifier.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementNotation(string id, string name, string @public, string system, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementNotation(id, name, @public, system, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element redefine. The redefine element redefines simple and complex types, groups, and attribute groups from an external schema.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="schemaLocation">Required. A URI to the location of a schema document.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementRedefine(string id, string schemaLocation, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementRedefine(id, schemaLocation, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element restriction. The restriction element defines restrictions on a simpleType, simpleContent, or complexContent definition.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="base">Required. Specifies the name of a built-in data type, simpleType element, or complexType element defined in this schema or another schema.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementRestriction(string id, string @base, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementRestriction(id, @base, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element schema. The schema element defines the root element of a schema.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="attributeFormDefault">Optional. The form for simpleTypes declared in the target namespace of this schema. 
        /// The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that simpleTypes from
        /// the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that simpleTypes
        /// from the target namespace must be qualified with the namespace prefix.</param>
        /// <param name="elementFormDefault">Optional. The form for elements declared in the target namespace of this schema.
        /// The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that elements
        /// from the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that
        /// elements from the target namespace must be qualified with the namespace prefix.</param>
        /// <param name="blockDefault">Optional. Specifies the default value of the block attribute on element and complexType elements
        /// in the target namespace. The block attribute prevents a complex type (or element) that has a specified type of derivation
        /// from being used in place of this complex type. This value can contain #all or a list that is a subset of extension,
        /// restriction, or substitution:
        /// * extension - prevents complex types derived by extension
        /// * restriction - prevents complex types derived by restriction
        /// * substitution - prevents substitution of elements
        /// * #all - prevents all derived complex types.
        /// </param>
        /// <param name="finalDefault">Optional. Specifies the default value of the final attribute on element, simpleType,
        /// and complexType elements in the target namespace. The final attribute prevents a specified type of derivation of an element,
        /// simpleType, or complexType element. For element and complexType elements, this value can contain #all or a list that is
        /// a subset of extension or restriction. For simpleType elements, this value can additionally contain list and union:
        /// * extension - prevents derivation by extension
        /// * restriction - prevents derivation by restriction
        /// * list - prevents derivation by list
        /// * union - prevents derivation by union
        /// * #all - prevents all derivation.
        /// </param>
        /// <param name="targetNamespace">Optional. A URI reference of the namespace of this schema.</param>
        /// <param name="version">Optional. Specifies the version of the schema.</param>
        /// <param name="xmlns">A URI reference that specifies one or more namespaces for use in this schema. If no prefix is assigned, the schema
        /// components of the namespace can be used with unqualified references.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns></returns>
        public BigXmlNode CreateElementSchema(string id, Form? attributeFormDefault, Form? elementFormDefault, string blockDefault,
            string finalDefault, string targetNamespace, string version, string xmlns, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementSchema(id, attributeFormDefault, elementFormDefault, blockDefault, finalDefault, targetNamespace, version, xmlns, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element selector. The selector element specifies an XPath expression that
        /// selects a set of elements for an identity constraint (unique, key, and keyref elements).
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="xpath">Required. Specifies an XPath expression, relative to the element being declared,
        /// that identifies the child elements to which the identity constraint applies.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementSelector(string id, string xpath, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementSelector(id, xpath, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element sequence. The sequence element specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="maxOccurs">Optional. Specifies the maximum number of times the sequence element can occur in the parent element.
        /// The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1.</param>
        /// <param name="minOccurs">Optional. Specifies the minimum number of times the sequence element
        /// can occur in the parent element. The value can be any number >= 0. Default value is 1.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementSequence(string id, string maxOccurs, string minOccurs, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementSequence(id, maxOccurs, minOccurs, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element simpleContent. The simpleContent element contains extensions or restrictions on a text-only
        /// complex type or on a simple type as content and contains no elements.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementSimpleContent(string id, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementSimpleContent(id, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element simpleType. The simpleType element defines a simple type and specifies
        /// the constraints and information about the values of simpleTypes or text-only elements.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Specifies a name for the element. This attribute is required if the simpleType
        /// element is a child of the schema element, otherwise it is not allowed.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementSimpleType(string id, string name, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementSimpleType(id, name, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element union. The union element defines a simple type as a collection (union) of values from specified simple data types.
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="memberTypes">Optional. Specifies a list of built-in data types or simpleType elements defined in a schema.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementUnion(string id, string memberTypes, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementUnion(id, memberTypes, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element unique. The unique element defines that an element or an attribute value must be unique within the scope.
        /// The unique element MUST contain the following (in order):
        /// * one and only one selector element  (contains an XPath expression that specifies the set of elements across which the values specified by field must be unique)
        /// * one or more field elements (contains an XPath expression that specifies the values that must be unique for the set of elements specified by the selector element)
        /// </summary>
        /// <param name="id">Optional. Specifies a unique ID for the element.</param>
        /// <param name="name">Required. Specifies a name for the element.</param>
        /// <param name="additionalAttributes">Optional. Specifies any other simpleTypes with non-schema namespace.</param>
        /// <param name="parent">Optional parent element.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementUnique(string id, string name, IEnumerable<IBigXmlAttribute> additionalAttributes, XsdElement? parent) {
            return this.xsdModel.CreateElementUnique(id, name, additionalAttributes, parent);
        }

        /// <summary>
        /// Creates element enumeration.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementEnumeration(string value) {
            return this.xsdModel.CreateElementEnumeration(value);
        }

        /// <summary>
        /// Creates element fractionDigits.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementFractionDigits(string value) {
            return this.xsdModel.CreateElementFractionDigits(value);
        }

        /// <summary>
        /// Creates element length.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementLength(string value) {
            return this.xsdModel.CreateElementLength(value);
        }

        /// <summary>
        /// Creates element maxExclusive.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMaxExclusive(string value) {
            return this.xsdModel.CreateElementMaxExclusive(value);
        }

        /// <summary>
        /// Creates element maxInclusive.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMaxInclusive(string value) {
            return this.xsdModel.CreateElementMaxInclusive(value);
        }

        /// <summary>
        /// Creates element maxLength.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMaxLength(string value) {
            return this.xsdModel.CreateElementMaxLength(value);
        }

        /// <summary>
        /// Creates element minExclusive.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMinExclusive(string value) {
            return this.xsdModel.CreateElementMinExclusive(value);
        }

        /// <summary>
        /// Creates element minInclusive.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMinInclusive(string value) {
            return this.xsdModel.CreateElementMinInclusive(value);
        }

        /// <summary>
        /// Creates element minLength.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementMinLength(string value) {
            return this.xsdModel.CreateElementMinLength(value);
        }

        /// <summary>
        /// Creates element pattern.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementPattern(string value) {
            return this.xsdModel.CreateElementPattern(value);
        }

        /// <summary>
        /// Creates element totalDigits.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementTotalDigits(string value) {
            return this.xsdModel.CreateElementTotalDigits(value);
        }

        /// <summary>
        /// Creates element whiteSpace.
        /// </summary>
        /// <param name="value">Value to set.</param>
        /// <returns>Created element.</returns>
        public BigXmlNode CreateElementWhiteSpace(string value) {
            return this.xsdModel.CreateElementWhiteSpace(value);
        }
        #endregion
        #endregion
        #endregion
    }
}